<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=<device-width>, initial-scale=1.0">
    <title>location对象</title>
    <style>
        body{
            background-color: gray;
        }
        div{
            margin: 20px;
            width: 350px;
            height: 150px;
            border: 1px solid #000;
            background-color: white;
            padding: 10px;
        }
        h2{
            text-align: center;
        }
        span{
            font-size: 150%;
            color: red;
            margin: 0 10px;
        }
    </style>
</head>
<body>
    <!--<iframe name="fram01"></iframe>
    <iframe name="fram02"></iframe>
    <iframe name="fram03"></iframe>-->

    <div>
        <h2>提交成功</h2>
        <a href="http://www.baidu.com">
        <span id="seconds">3</span>秒后系统自动跳转，也可单击此链接跳转</a>

    </div>
</body>
    <script>


        function timing(secs,url){
            var seconds = document.getElementById('seconds');
           // seconds.innerHTML == --secs;
            seconds.innerText == --secs;
            if(secs >0){
                setTimeout('timing(' + secs + ',\''+url + '\')',1000);
            }else{
                location.href = url;
            }
        }
        timing(3,"https://www.baidu.com");

        // window.frames['frame01'].document.write('frame01 text.');
        // window.frames.frames02.document.write('frame02 text.');
        // window.frames[2].document.write('frame03 text.');

        //setTimeout()方法用于在指定的毫秒数后调用函数计算或计算表达式
        // setTimeout(function(){
        //     alert("Hello");
        // },3000);

        //setInterval()方法可按照指定周期（以毫秒计）
        // setInterval(function(){
        //     document.write("Hello");
        // },3000);

        //console.log(location.host);
    </script>
</html>